package at.chl.lution.creator;

import java.util.ArrayList;
import java.util.List;

import at.chl.genetic.function.math.factory.MathNodeFactory;
import at.chl.genetic.function.math.types.MathParamType;
import at.chl.genetic.node.IDecisionNode;

public class SimpleExpectedResultCreator extends BasicExpectedResultCreator
		implements IExpectedResultCreator {
	
	public SimpleExpectedResultCreator() {
		//result=if(x>=512) >> a : b
		//a = y + 33;
		//b = y + x;
		IDecisionNode root=MathNodeFactory.createIfBiggerNode();
		
		IDecisionNode rootChild1=MathNodeFactory.createParamNode(MathParamType.PARAM_X);
		
		IDecisionNode rootChild2=MathNodeFactory.createConstantNode(512);
		
		IDecisionNode rootChild3=MathNodeFactory.createAddNode();
		IDecisionNode rootChild3Child1=MathNodeFactory.createParamNode(MathParamType.PARAM_Y);
		IDecisionNode rootChild3Child2=MathNodeFactory.createConstantNode(33);
		
		
		IDecisionNode rootChild4=MathNodeFactory.createAddNode();
		IDecisionNode rootChild4Child1=MathNodeFactory.createParamNode(MathParamType.PARAM_Y);
		IDecisionNode rootChild4Child2=MathNodeFactory.createParamNode(MathParamType.PARAM_X);
	
	
		List<IDecisionNode> rootChild4Childs=new ArrayList<IDecisionNode>();
		
		rootChild4Childs.add(rootChild4Child1);
		rootChild4Childs.add(rootChild4Child2);
		rootChild4.setChildNodes(rootChild4Childs);
		
		List<IDecisionNode> rootChild3Childs=new ArrayList<IDecisionNode>();
		rootChild3Childs.add(rootChild3Child1);
		rootChild3Childs.add(rootChild3Child2);
		rootChild3.setChildNodes(rootChild3Childs);
		
		List<IDecisionNode> rootChilds=new ArrayList<IDecisionNode>();
		rootChilds.add(rootChild1);
		rootChilds.add(rootChild2);
		rootChilds.add(rootChild3);
		rootChilds.add(rootChild4);
		root.setChildNodes(rootChilds);
		
		
//		root.print("");
		setExpectedDecisionTree(root);
	}

}
